package com.jingze.plugins.monitor.customize;

public class Check {
    //artNetAdress:控制器地址默认为：2.0.0.100
    //dmxChanngel：通讯通道（1-8）
    //lightNo:灯点号（最大不超过170）
    public int doCheck(String artNetAdress , int dmxChanngel , int lightNo) throws InterruptedException {

        JArtNet artNet1 = new JArtNet(artNetAdress);
        JArtNet artNet2 = new JArtNet(artNetAdress);
        JArtNet artNet3 = new JArtNet(artNetAdress);
        JArtNet artNet4 = new JArtNet(artNetAdress);
        JArtNet artNet5 = new JArtNet(artNetAdress);
        JArtNet artNet6 = new JArtNet(artNetAdress);
        JArtNet artNet7 = new JArtNet(artNetAdress);
        JArtNet artNet8 = new JArtNet(artNetAdress);
        artNet1.send(1);
        artNet2.send(2);
        artNet3.send(3);
        artNet4.send(4);
        artNet5.send(5);
        artNet6.send(6);
        artNet7.send(7);
        artNet8.send(8);
        switch (dmxChanngel)
        {

            case 8:
                artNet8.set((lightNo - 1)*3,255);
                artNet8.set((lightNo - 1 )*3 +1,255);
                artNet8.set((lightNo - 1 )*3 +2,255);
                artNet8.send(dmxChanngel);
                break;
            case 7:
                artNet7.set((lightNo - 1)*3,255);
                artNet7.set((lightNo - 1 )*3 +1,255);
                artNet7.set((lightNo - 1 )*3 +2,255);
                artNet7.send(dmxChanngel);
                break;
            case 6:
                artNet6.set((lightNo - 1)*3,255);
                artNet6.set((lightNo - 1 )*3 +1,255);
                artNet6.set((lightNo - 1 )*3 +2,255);
                artNet6.send(dmxChanngel);
                break;
            case 5:
                artNet5.set((lightNo - 1)*3,255);
                artNet5.set((lightNo - 1 )*3 +1,255);
                artNet5.set((lightNo - 1 )*3 +2,255);
                artNet5.send(dmxChanngel);
                break;
            case 4:
                artNet4.set((lightNo - 1)*3,255);
                artNet4.set((lightNo - 1 )*3 +1,255);
                artNet4.set((lightNo - 1 )*3 +2,255);
                artNet4.send(dmxChanngel);
                break;
            case 3:
                artNet3.set((lightNo - 1)*3,255);
                artNet3.set((lightNo - 1 )*3 +1,255);
                artNet3.set((lightNo - 1 )*3 +2,255);
                artNet3.send(dmxChanngel);
                break;
            case 2:
                artNet2.set((lightNo - 1)*3,255);
                artNet2.set((lightNo - 1 )*3 +1,255);
                artNet2.set((lightNo - 1 )*3 +2,255);
                artNet2.send(dmxChanngel);
                break;
            case 1:
                artNet1.set((lightNo - 1)*3,255);
                artNet1.set((lightNo - 1 )*3 +1,255);
                artNet1.set((lightNo - 1 )*3 +2,255);
                artNet1.send(dmxChanngel);
                break;
            default :
                artNet1.set((lightNo - 1)*3,255);
                artNet1.set((lightNo - 1 )*3 +1,255);
                artNet1.set((lightNo - 1 )*3 +2,255);
                artNet1.send(dmxChanngel);
                break;
        }
        return 1;
    }
}
